package com.wlsk.license.common.utils;

/**
 * @description: 订单锁工具类
 * @author: liuzhangbin
 * @date: 2025/2/19
 */
public class OrderLockUtils {

    // 获取锁等待时长(秒)
    public static final int LOCK_WAIT_TIME_SECOND = 15;

    private static final String ORDER_LOCK_PREFIX = "chartered:plate:lock:%s";

    /**
     * 获取包车牌锁key
     *
     * @param plateId
     * @return
     */
    public static String getLockKey(Long plateId) {
        ValidationUtils.notNull(plateId, "包车牌申请号不能为空");
        return String.format(ORDER_LOCK_PREFIX, plateId.toString());
    }

}
